//! Copyright 2012 Xicut Technology, Inc.
//! All rights reserved
//!
#ifndef __Sensor_h__
#define __Sensor_h__

#include "BasicTypes.h"
//#include "SensorCheck.h"
#include "SysTick.h"


class cSensor
{
public:
    struct ssBit
    {
        U32 Conveyer_1  :1;
        U32 Conveyer_2  :1;
        U32 Conveyer_3  :1;
        U32 Carbin_1    :1;
        U32 Carbin_2    :1;
        U32 Carbin_3    :1;
        U32 TopCarbin   :1;
        U32 Gate        :1;
        U32 Carbin      :1;
        U32 ProductOut  :1;
    };
    union uSensor
    {
        U32 val;
        ssBit detail;
    };

private:
    static uSensor  sCurStatus;
    static uSensor  sSensorStatus;
    static uSensor  sSensorChange;
    static cSysTick sTimeDebounce;

public:
    static void InitReset();
    static uSensor GetStatus();
    static uSensor GetChange();
    static void RunOne();
private:
    static void UpdateStatus(uSensor &ss);
};

#endif // __Sensor_h__
